
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED

#include <stdlib.h>

#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif 

#if JSON_USE_EXCEPTION
#include <stdexcept>
#define JSON_ASSERT(condition)                                                 \
  assert(condition); 
#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);
#else 
#define JSON_ASSERT(condition) assert(condition);

#define JSON_FAIL_MESSAGE(message)                                             \
  {                                                                            \
    assert(false&& message);                                                   \
    strcpy(reinterpret_cast<char*>(666), message);                             \
    exit(123);                                                                 \
  }

#endif

#define JSON_ASSERT_MESSAGE(condition, message)                                \
  if (!(condition)) {                                                          \
    JSON_FAIL_MESSAGE(message)                                                 \
  }

#endif 
